import pymysql


conn=pymysql.connect(host='127.0.0.1',port=3306,user='root',passwd='123456',db='python',charset='utf8');

cursor=conn.cursor();
cursor.execute("SELECT * FROM TB_Goods");
results=cursor.fetchall();
for row in results:
    ID=row[0];
    name=row[1];
    price=str(row[2]);
    print("ID=%s,name=%s,age=%",(ID,name,price))

conn.commit();
conn.close();
